В C++11 и новее появились атрибуты — механизм, о котором многие забывают. Атрибуты позволяют передавать дополнительную информацию компилятору, не меняя семантику кода.
[[nodiscard]] int getValue() { return 42; }
void test() { getValue(); // Предупреждение: результат функции не используется }
class [[deprecated("Используйте новый API")]] OldClass {};
// C++20: говорит компилятору, что код с [[likely]] будет выполняться чаще void process(int* data) { if (data) [[likely]] { process_data(data); } else [[unlikely]] { handle_null(); } }
Другие полезные атрибуты: [[maybe_unused]], [[fallthrough]], [[no_unique_address]] (C++20). Они делают код понятнее и помогают избежать ошибок😸
В C++11 и новее появились атрибуты — механизм, о котором многие забывают. Атрибуты позволяют передавать дополнительную информацию компилятору, не меняя семантику кода.
[[nodiscard]] int getValue() { return 42; }
void test() { getValue(); // Предупреждение: результат функции не используется }
class [[deprecated("Используйте новый API")]] OldClass {};
// C++20: говорит компилятору, что код с [[likely]] будет выполняться чаще void process(int* data) { if (data) [[likely]] { process_data(data); } else [[unlikely]] { handle_null(); } }
Другие полезные атрибуты: [[maybe_unused]], [[fallthrough]], [[no_unique_address]] (C++20). Они делают код понятнее и помогают избежать ошибок😸
I have no inside knowledge of a potential stock listing of the popular anti-Whatsapp messaging app, Telegram. But I know this much, judging by most people I talk to, especially crypto investors, if Telegram ever went public, people would gobble it up. I know I would. I’m waiting for it. So is Sergei Sergienko, who claims he owns $800,000 of Telegram’s pre-initial coin offering (ICO) tokens. “If Telegram does a SPAC IPO, there would be demand for this issue. It would probably outstrip the interest we saw during the ICO. Why? Because as of right now Telegram looks like a liberal application that can accept anyone - right after WhatsApp and others have turn on the censorship,” he says.
The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.
Библиотека C C разработчика | cpp boost qt from us